package com.zatech.cgnci.project.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

@Getter
@AllArgsConstructor
public enum BillTypeEnum {

    CONTRACT_INVOICE("01", "合约账单"),
    PROPORTIONAL_LIABILITY_INVOICE("02", "临分摊赔账单"),
    REINSURANCE_PREMIUM_BILL("03", "临分保费账单"),
    ;

    public static BillTypeEnum getEnumByCode(String code) {
        return Arrays.stream(values()).filter(e -> Objects.equals(e.getCode(), code)).findAny().orElse(null);
    }

    private String code;
    private String descr;
}
